﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2024 LiLong                                                   **
**  This file is part of RinexFileReader.                                       **
**                                                                              **
**  RinexFileReader is free software: you can redistribute it and/or modify     **
**  it under the terms of the GNU General Public License as published by        **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  RinexFileReader is distributed in the hope that it will be useful,          **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU General Public License for more details.                                **
**                                                                              **
**  You should have received a copy of the GNU General Public License           **
**  along with RinexFileReader. If not, see <https://www.gnu.org/licenses/>.    **
**********************************************************************************/
#pragma once

#include "Datadefine.h"
#include "RinexFileReaderGlobal.h"

#include <memory>

namespace Rinex
{
struct NavigationMessageData;
class RINEXFILEREADER_EXPORT NavigationMessageFile
{
public:
    NavigationMessageFile(NavigationMessageFile&& other) noexcept;
    NavigationMessageFile(const NavigationMessageFile& other);
    ~NavigationMessageFile();
    NavigationMessageFile& operator=(NavigationMessageFile&& other) noexcept;
    NavigationMessageFile& operator=(const NavigationMessageFile& other);
    // IONEX VERSION / TYPE
    double version() const;
    SatelliteSystem satelliteSystem() const;
    // PGM / RUN BY / DATE
    const std::string& program() const;
    const std::string& agency() const;
    const std::string& createDateTime() const;
    // REC # / TYPE / VERS
    const std::optional<std::string>& recNumber() const;
    const std::optional<std::string>& recType() const;
    const std::optional<std::string>& recVersion() const;
    // COMMENT
    const std::vector<std::string>& comments() const;
    // IONOSPHERIC CORR
    const std::vector<IonosphericCorr>& ionosphericCorrs() const;
    // TIME SYSTEM CORR
    const std::vector<TimeSystemCorr>& timeSystemCorrs() const;
    // MERGED FILE
    const std::optional<int>& mergedFile() const;
    // DOI
    const std::optional<std::string>& doi() const;
    // LICENSE OF USE
    const std::optional<std::string>& licenseOfUse() const;
    // STATION INFORMATION
    const std::optional<std::string>& stationInformation() const;
    // LEAP SECONDS
    const LeapSeconds& leapSeconds() const;
    ///////////////////////////////////////////
    const std::vector<NMData>& datas() const;

protected:
    NavigationMessageFile(std::shared_ptr<NavigationMessageData> d);
    friend class RindexFile;

private:
    struct Impl;
    std::unique_ptr<Impl> m_impl;
};
} // namespace Rinex